package com.fsl.springbootdesignpattern.m_delegate;

import java.util.ArrayList;
import java.util.List;

/**
 * 项目经理，管理多少个程序员
 */
public class PM {

    private static List<Developer> developerList = new ArrayList<>();

    static {
        developerList.add(new XiaoHong());
        developerList.add(new XiaoMing());
    }

    public void doing(String development){
        if("优惠券".equals(development)){
            //优惠券功能由XiaoHong开发
            developerList.get(0).developSomething(development);
        }else if("汽车商城".equals(development)){
            //汽车商城功能由XiaoMing开发
            developerList.get(1).developSomething(development);
        }else{
            System.out.println("暂时不能开发");
        }
    }
}
